<!doctype html>
<html>
<head>
<title>广州综合配餐平台</title>
<meta charset="utf-8" />
<script type="text/javascript" src="js/head.js"></script>
<link rel="stylesheet" type="text/css" href="css/artfair.css"/>
<link rel="stylesheet" type="text/css" href="css/page.css"/>
<head>
<body class="app" data-ad="true">

<section class="app-content">
	<section class="page page-index noline" data-plugin-type="info_front">
        <div class="top-bar">在线反馈<a href="<?php echo $this->url('my', array('action'=>'home'));?>" class="btn-t-back"></a></div>
        <p class="recharge">
            <textarea id="message" class="opinion" name="opinion" placeholder="亲，请提供您的反馈意见呗（不少于5个字）"></textarea>
        </p>
        <p class="recharge mt20">
            <textarea id="cellphone" class="opinion" name="opinion" placeholder="哦，您手机号哪里去了呢？？？"></textarea>
        </p>
        <p class="recharge mt20">
            <a class="btn-yel btn-w mt5" href="javascript:saveMessage();">提交</a>
        </p>
	</section>

    <!-- 底部menu-->
    <div class="g_menu">
        <a href="javascript:;">配餐</a><a href="javascript:;">溯源</a><a class="on" href="javascript:;">我的</a>
    </div>
</section>

<script type="text/javascript" src="js/zepto.min.js"></script>
<script type="text/javascript" src="js/swiper.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
var userid="<?php echo $this->userid; ?>";
function saveMessage(){
	var message=$("#message").val();
	var cellphone=$("#cellphone").val();
	if(message.length<5){
		alert("亲，少于5个字!");
		return false;
	}

	if(!(/^1[34578]\d{9}$/.test(cellphone))){
        alert("手机号码有误，请重填");  
        return false; 
	}

    $.ajax({
        url:"/feedback/savemessage",
        type:"post",
        data:{userid:userid,message:message,cellphone:cellphone},
        dataType:"json",
        success:function(rs){
			if(rs.status=="success"){
				alert("提交成功!");
			}else{
				alert("提交失败!");
			}
        }
	});
	
}
$(function () {
});
</script>
</body>
</html>